package com.klangner.animation.path
{
  import com.klangner.animation.path.api.IPath;
  
  import flash.geom.Point;

  public class EllipticalPath implements IPath
  {
    private var _centerX:Number;
    private var _centerY:Number;
    private var _angle:Number = 0;
    private var _speed:Number = 0.1;
    private var _radius:Number = 100;
    private var _position:Point = new Point(); 
    
    public function EllipticalPath(centerX:Number, centerY:Number){
      _centerX = centerX;
      _centerY = centerY;
    }

    public function move():void{
      
      _position.x = _centerX + Math.sin(_angle) * _radius;
      _position.y = _centerY + Math.cos(_angle) * _radius;
      
      _angle += _speed;
    }
    
    public function get position():Point{
      
      return new Point(_position.x, _position.y);
    }
    
    public function get angle():Number{
      
      return 0;
    }
    
  }
}